<%@page import="java.util.Random"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/view/common/common.jsp"%>
<script type="text/javascript">
	function getPid(){
		var pid = null;
		var type =  ${SESSION_INFO_OBJECT.type};
		var phone =  ${SESSION_INFO_OBJECT.tel};
		if(type==1){//普通管理员，需要抓取当前账户userid作为pid
			var url ='${ctx}/user/getUserByPhone.do';
			$.ajaxSettings.async = false;
			$.post(url,{"phone":phone},function(result){
				var result = eval('(' + result + ')');
				if (result.isSuc) {
					console.log(result.user.id);
					pid = result.user.id;
				}
			})
			$.ajaxSettings.async = true;
		}else if(type==0){//超级管理员
			pid = -1;
		}
		return pid;
	}
</script>


</head>
<body>

		<%--<div id="system_user_list_tb" style="height:auto;padding-left:auto;">--%>
			<%--<c:forEach items="${list}" var="AdminPrivilege">--%>
					<%--<c:if test="${AdminPrivilege.code=='add'}">--%>
						<%--<a href="#" class="easyui-linkbutton" onclick="add()" data-options="iconCls:'icon-add',plain:true">添加</a>--%>
					<%--</c:if>--%>
					<%--<c:if test="${AdminPrivilege.code=='edit'}">--%>
						<%--<a href="#" class="easyui-linkbutton" onclick="update()" data-options="iconCls:'icon-edit',plain:true">编辑</a>--%>
					<%--</c:if>--%>
					<%--<c:if test="${AdminPrivilege.code=='delete'}">--%>
						<%--<a href="#" class="easyui-linkbutton" onclick="deleteInfo()" data-options="iconCls:'icon-remove',plain:true">删除</a>--%>
					<%--</c:if>--%>
			<%--</c:forEach> --%>
			<%--<a href="#" class="easyui-linkbutton" onclick="refresh()" data-options="iconCls:'icon-reload',plain:true">刷新</a>--%>
			<%----%>
			<%----%>
	<%--</div>   											--%>
	

<table id="region_treegrid"  class="easyui-treegrid" data-options="fit:false,
		toolbar:'#system_user_list_tb',
		url: '${ctx}/invitation/userRation.do?pId='+getPid(), 
        rownumbers: true,
        pagination: true,
        idField: 'id',
        treeField: 'nickName',
        singleSelect:true,
        pagePosition: 'top',
        onBeforeLoad: function(row,param){
            if (!row) {    
                param.id = 0;
            }
        }
   
">
	<thead>
		<tr>
		
			<th data-options="field:'nickName',width:150" align="left">
				昵称
			</th>
			<th data-options="field:'phone',width:130" align="center">
				手机
			</th>
			<th data-options="field:'uid',width:130" align="center">
				uid
			</th>
			<th data-options="field:'nodeBlock',width:130" align="center">
				关系
			</th>

		</tr>
	</thead>
</table>
	    


	
	
</body>
</html>